package com.mars.dbhandler.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitMQConfig {

    @Bean
    public Queue objectQueue(){
        return new Queue("objectQueue");
    }

    @Bean
    public TopicExchange objectExchange(){
        return new TopicExchange("objectExchange");
    }

    @Bean
    public Binding objectQueueBinding(Queue objectQueue, TopicExchange objectExchange){
        return BindingBuilder.bind(objectQueue).to(objectExchange).with("objectQueue");
    }

}
